import { postAction } from '../request'

export interface IApi {
  URL_BLOGLIST: string;
  URL_BLOGDEL: string;
  login: BaseResponseFn;
  register: BaseResponseFn;
  authCode: BaseResponseFn;
  keyCode: BaseResponseFn;
  emailAuthCode: BaseResponseFn;
  blogDetail: BaseResponseFn;
  blogCheck: BaseResponseFn;
  contextedAccount: BaseResponseFn;
}

// 登录接口
const URL_LOGIN = '/note/user-login'
export const login = (params?: any) => postAction(URL_LOGIN, params)

// 注册接口
const URL_REGISTER = '/note/user-sign'
export const register = (params?: any) => postAction(URL_REGISTER, params)

// 验证码
const URL_AUTHCODE = '/note/user-login-auth'
export const authCode = (params?: any) => postAction(URL_AUTHCODE, params)

// 秘钥
const URL_KEYCODE = '/note/user-keyCode'
export const keyCode = (params?: any) => postAction(URL_KEYCODE, params)

// 邮箱验证码
const URL_EMAILAUTHCODE = '/note/user-sign-auth'
export const emailAuthCode = (params?: any) => postAction(URL_EMAILAUTHCODE, params)

// 邮箱验证码
const URL_CONNEXTEDACCOUNT = '/note/user-connexted-Account'
export const contextedAccount = (params?: any) => postAction(URL_CONNEXTEDACCOUNT, params)

// 发布文章
const URL_BLOGISSUE = '/note/blog-issue'
export const blogIsSue = (params?: any) => postAction(URL_BLOGISSUE, params)

// 更新文章
const URL_BLOGUPDATE = '/note/blog-update'
export const blogUpdate = (params?: any) => postAction(URL_BLOGUPDATE, params)

// 发布文章
const URL_BLOGDETAIL = '/note/blog-detail'
export const blogDetail = (params?: any) => postAction(URL_BLOGDETAIL, params)

// 文章列表
export const URL_BLOGLIST = '/note/blog-list'

// 删除文章
export const URL_BLOGDEL = '/note/blog-del'

// 审批文章
export const URL_CHECK = '/note/blog-check'
export const blogCheck = (params?: any) => postAction(URL_CHECK, params)

